package core;

import core.place.*;

/**
 * Class File : save informations about the file that user want to copy
 * @project Universalcopy
 * @author Aurele TONNERRE, Romain Monnier
 */
public class File
{
    
    private String name;
    private Place origin;
    private java.io.File theFile;
    
    
    /**
     * Constructs a new File
     * @param url : the url of the file to copy
     */
    public File(String url)
    {
        theFile = new java.io.File(url);
        name = theFile.getName();
        
    }
    
    
    /**
     * Returns the name of the file
     * @return name : the name of the file
     */
    public String getName()
    {
        return this.name;
    }

    
    /**
     * Returns the complete url of the file
     * @return url : the complete url of the file
     */
    public String getUrlOrigin()
    {
        return this.origin.getUrl();   
    }
    
    
    /**
     * Returns the java.io.File corresponding of the file to copy
     * @return file : the file
     */
    public java.io.File getFile() {
        return this.theFile;
    }
}
